﻿/// <reference path="../Site.js" />
/// <reference path="Login.js" />
/// <reference path="Container.js" />

(function () {
    var obj = this;
    var element = $(this);
    var controls = {

    };

    iuPlace.Application.OnInitialized(onInitialized);
    iuPlace.Application.OnOpenSession(onOpenSession);

    function onInitialized() {
        iuPlace.Application.OpenSession(false);
    };

    function onOpenSession(e, success) {
        if (!success)
            iuPlace.Application.Site.Main.Login.Mode(iuPlace.Application.Site.Main.Login.Types.TypeMode.Login);
        else {
            iuPlace.Application.Site.Main.Login.Visible(false);
            iuPlace.Application.Site.Main.Container.Visible(true);
        }
    };

    $.extend(iuPlace.Application.Site.Main, {

    });
})();











///// <reference path="../Site.js" />
///// <reference path="Login.js" />
///// <reference path="Container.js" />

////iuPlace.Application.Site.Main = {
////};

//(function () {
//    var obj = this;
//    var element = $(this);
//    var controls = {
//        teste: element,
//        buttonLogin: element
//    };

//    iuPlace.Application.OnInitialized(onInitialized);
//    iuPlace.Application.OnOpenSession(onOpenSession);

//    function onOpenSession(e, success) {
//        if (!success)
//            iuPlace.Application.Mobile.Main.Login.Mode(iuPlace.Application.Mobile.Main.Login.Types.TypeMode.Login);
//        else {
//            iuPlace.Application.Mobile.Main.Login.Visible(false);
//            iuPlace.Application.Mobile.Main.Container.Visible(true);
//        }
//    };

//    $(function () {
//        Loaded();
//    });

//    function onInitialized() {
//        iuPlace.Application.OpenSession(false);
//    };

//    //region methods

//    function btnLoginOnClick() {
////        iuPlace.Api.Request("Site/Default/Main/", true, null, function (dataResult) {
////            if (!dataResult.IsError) {
////                //iuPlace.Api.Session = dataResult.Data;

////            }
////            if ($.isFunction(callback))
////                callback(dataResult);
////            if (dataResult.IsErro) {
////                alert(dataResult.toString());
////            }
////        });
//    };



//    //endregion methods


//    function Loaded() {
//        controls.btnLogin = $("#buttonLogin").click(btnLoginOnClick);

//    };


//    $.extend(iuPlace.Application.Site.Main, {

//    });
//})();